.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 32px;
  background-color: #f8f9fa;
  border-bottom: 2px solid #e1e1e1;
  width: 100%;
  box-sizing: border-box;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
}

.navbar-left,
.navbar-right {
  display: flex;
  align-items: center;
  gap: 40px;
}

.navbar-item {
  text-decoration: none;
  color: #333;
  font-weight: 600;
  font-size: 18px;
  padding: 12px 18px;
  transition: color 0.3s ease;
}

.navbar-userId {
  text-decoration: none;
  color: #333;
  font-weight: 600;
  font-size: 18px;
  padding: 12px 18px;
  transition: color 0.3s ease;
}

.navbar-item:hover {
  color: #1890ff;
  background-color: #f0f8ff;
}

.navbar-search-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-bar {
  padding: 15px 30px;
  border: 2px solid #ddd;
  border-radius: 8px;
  min-width: 500px;
  font-size: 18px;
}

.search-link {
  white-space: nowrap;
}

.search-bar:focus {
  border-color: #1890ff;
  box-shadow: 0 0 5px rgba(24, 144, 255, 0.3);
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: #ccc;
  object-fit: cover;
}

.navbar-username {
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

/* 用户配置文件容器 */
.user-profile-container {
  position: relative;
}

.user-profile-button {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 8px;
  transition: background-color 0.3s ease;
}

.user-profile-button:hover {
  background-color: #f0f0f0;
}

.dropdown-icon {
  display: flex;
  align-items: center;
  transition: transform 0.3s ease;
}

.dropdown-icon.rotated {
  transform: rotate(180deg);
}

.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: white;
  border: 1px solid #e1e1e1;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  min-width: 180px;
  z-index: 1001;
  overflow: hidden;
  margin-top: 4px;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  text-decoration: none;
  color: #333;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.3s ease;
  font-size: 14px;
}

.dropdown-item:hover {
  background-color: #f8f9fa;
}

.logout-item {
  color: #ff4d4f;
  border-top: 1px solid #f0f0f0;
}

.logout-item:hover {
  background-color: #fff2f0;
}

.auth-buttons {
  display: flex;
  align-items: center;
  gap: 16px;
}

.navbar-spacer {
  height: 80px; /* 根据导航条高度调整 */
}

/* 响应式设计 */
@media (max-width: 768px) {
  .navbar {
    padding: 8px 16px;
    flex-wrap: wrap;
  }

  .navbar-left,
  .navbar-right {
    gap: 20px;
  }

  .search-bar {
    min-width: 300px;
    padding: 10px 20px;
    font-size: 16px;
  }

  .navbar-item {
    font-size: 16px;
    padding: 8px 12px;
  }

  .navbar-username {
    display: none; /* 在小屏幕上隐藏用户名 */
  }
}

@media (max-width: 480px) {
  .navbar-center {
    order: 3;
    width: 100%;
    margin-top: 12px;
  }

  .search-bar {
    width: 100%;
    min-width: auto;
  }

  .navbar-left,
  .navbar-right {
    gap: 12px;
  }

  .navbar-item {
    padding: 6px 10px;
    font-size: 14px;
  }
}
